// 初始状态
const initState = { name: "cowen", age: 38, salary: 10000 };

// reducer函数
const reducer = (state, action) => {
    switch (action.type) {
        case "ADD_AGE":
            return { ...state, age: state.age + 1 };
            break;
        case "ADD_SALARY":
            return { ...state, salary: state.salary + 1000 };
            break;
        default:
            return state;
            break;
    }
};

export { initState, reducer };
